BIN:=test
CC:=gcc
SRC:=$(wildcard *.c)
OBJ:=$(SRC:.c=.o)
FLAGS:=-o
FLAGSc:=-c
RM:= rm -f


$(BIN):$(OBJ)
	@$(CC) $(FLAGS) $@ $^
	@echo "Link $^ >> $@"

%.o:%.c
	@$(CC) $(FLAGSc) $<
	@echo "BianYi $< >> $@"





.PHONY:clean
clean:
	$(RM) $(BIN) $(OBJ)

.PHONY:print
print:
	@echo $(BIN)
	@echo $(CC)
	@echo $(SRC)
	@echo $(OBJ)
	@echo $(FLAGS)
	@echo $(RM)

